/*
 * XML Type:  MarginInterest
 * Namespace: http://ofx.net/types/2003/04
 * Java type: net.ofx.types.x2003.x04.MarginInterest
 *
 * Automatically generated - do not modify.
 */
package net.ofx.types.x2003.x04.impl;
/**
 * An XML MarginInterest(@http://ofx.net/types/2003/04).
 *
 * This is a complex type.
 */
public class MarginInterestImpl extends net.ofx.types.x2003.x04.impl.AbstractInvestmentTransactionImpl implements net.ofx.types.x2003.x04.MarginInterest
{
    
    public MarginInterestImpl(org.apache.xmlbeans.SchemaType sType)
    {
        super(sType);
    }
    
    private static final javax.xml.namespace.QName TOTAL$0 = 
        new javax.xml.namespace.QName("", "TOTAL");
    private static final javax.xml.namespace.QName SUBACCTFUND$2 = 
        new javax.xml.namespace.QName("", "SUBACCTFUND");
    private static final javax.xml.namespace.QName CURRENCY$4 = 
        new javax.xml.namespace.QName("", "CURRENCY");
    private static final javax.xml.namespace.QName ORIGCURRENCY$6 = 
        new javax.xml.namespace.QName("", "ORIGCURRENCY");
    
    
    /**
     * Gets the "TOTAL" element
     */
    public java.lang.String getTOTAL()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(TOTAL$0, 0);
            if (target == null)
            {
                return null;
            }
            return target.getStringValue();
        }
    }
    
    /**
     * Gets (as xml) the "TOTAL" element
     */
    public net.ofx.types.x2003.x04.AmountType xgetTOTAL()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.AmountType target = null;
            target = (net.ofx.types.x2003.x04.AmountType)get_store().find_element_user(TOTAL$0, 0);
            return target;
        }
    }
    
    /**
     * Sets the "TOTAL" element
     */
    public void setTOTAL(java.lang.String total)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(TOTAL$0, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(TOTAL$0);
            }
            target.setStringValue(total);
        }
    }
    
    /**
     * Sets (as xml) the "TOTAL" element
     */
    public void xsetTOTAL(net.ofx.types.x2003.x04.AmountType total)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.AmountType target = null;
            target = (net.ofx.types.x2003.x04.AmountType)get_store().find_element_user(TOTAL$0, 0);
            if (target == null)
            {
                target = (net.ofx.types.x2003.x04.AmountType)get_store().add_element_user(TOTAL$0);
            }
            target.set(total);
        }
    }
    
    /**
     * Gets the "SUBACCTFUND" element
     */
    public net.ofx.types.x2003.x04.SubAccountEnum.Enum getSUBACCTFUND()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(SUBACCTFUND$2, 0);
            if (target == null)
            {
                return null;
            }
            return (net.ofx.types.x2003.x04.SubAccountEnum.Enum)target.getEnumValue();
        }
    }
    
    /**
     * Gets (as xml) the "SUBACCTFUND" element
     */
    public net.ofx.types.x2003.x04.SubAccountEnum xgetSUBACCTFUND()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.SubAccountEnum target = null;
            target = (net.ofx.types.x2003.x04.SubAccountEnum)get_store().find_element_user(SUBACCTFUND$2, 0);
            return target;
        }
    }
    
    /**
     * Sets the "SUBACCTFUND" element
     */
    public void setSUBACCTFUND(net.ofx.types.x2003.x04.SubAccountEnum.Enum subacctfund)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(SUBACCTFUND$2, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(SUBACCTFUND$2);
            }
            target.setEnumValue(subacctfund);
        }
    }
    
    /**
     * Sets (as xml) the "SUBACCTFUND" element
     */
    public void xsetSUBACCTFUND(net.ofx.types.x2003.x04.SubAccountEnum subacctfund)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.SubAccountEnum target = null;
            target = (net.ofx.types.x2003.x04.SubAccountEnum)get_store().find_element_user(SUBACCTFUND$2, 0);
            if (target == null)
            {
                target = (net.ofx.types.x2003.x04.SubAccountEnum)get_store().add_element_user(SUBACCTFUND$2);
            }
            target.set(subacctfund);
        }
    }
    
    /**
     * Gets the "CURRENCY" element
     */
    public net.ofx.types.x2003.x04.Currency getCURRENCY()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.Currency target = null;
            target = (net.ofx.types.x2003.x04.Currency)get_store().find_element_user(CURRENCY$4, 0);
            if (target == null)
            {
                return null;
            }
            return target;
        }
    }
    
    /**
     * True if has "CURRENCY" element
     */
    public boolean isSetCURRENCY()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(CURRENCY$4) != 0;
        }
    }
    
    /**
     * Sets the "CURRENCY" element
     */
    public void setCURRENCY(net.ofx.types.x2003.x04.Currency currency)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.Currency target = null;
            target = (net.ofx.types.x2003.x04.Currency)get_store().find_element_user(CURRENCY$4, 0);
            if (target == null)
            {
                target = (net.ofx.types.x2003.x04.Currency)get_store().add_element_user(CURRENCY$4);
            }
            target.set(currency);
        }
    }
    
    /**
     * Appends and returns a new empty "CURRENCY" element
     */
    public net.ofx.types.x2003.x04.Currency addNewCURRENCY()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.Currency target = null;
            target = (net.ofx.types.x2003.x04.Currency)get_store().add_element_user(CURRENCY$4);
            return target;
        }
    }
    
    /**
     * Unsets the "CURRENCY" element
     */
    public void unsetCURRENCY()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(CURRENCY$4, 0);
        }
    }
    
    /**
     * Gets the "ORIGCURRENCY" element
     */
    public net.ofx.types.x2003.x04.Currency getORIGCURRENCY()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.Currency target = null;
            target = (net.ofx.types.x2003.x04.Currency)get_store().find_element_user(ORIGCURRENCY$6, 0);
            if (target == null)
            {
                return null;
            }
            return target;
        }
    }
    
    /**
     * True if has "ORIGCURRENCY" element
     */
    public boolean isSetORIGCURRENCY()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(ORIGCURRENCY$6) != 0;
        }
    }
    
    /**
     * Sets the "ORIGCURRENCY" element
     */
    public void setORIGCURRENCY(net.ofx.types.x2003.x04.Currency origcurrency)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.Currency target = null;
            target = (net.ofx.types.x2003.x04.Currency)get_store().find_element_user(ORIGCURRENCY$6, 0);
            if (target == null)
            {
                target = (net.ofx.types.x2003.x04.Currency)get_store().add_element_user(ORIGCURRENCY$6);
            }
            target.set(origcurrency);
        }
    }
    
    /**
     * Appends and returns a new empty "ORIGCURRENCY" element
     */
    public net.ofx.types.x2003.x04.Currency addNewORIGCURRENCY()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.Currency target = null;
            target = (net.ofx.types.x2003.x04.Currency)get_store().add_element_user(ORIGCURRENCY$6);
            return target;
        }
    }
    
    /**
     * Unsets the "ORIGCURRENCY" element
     */
    public void unsetORIGCURRENCY()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(ORIGCURRENCY$6, 0);
        }
    }
}
